<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade" id="fotoContainer_{%=file.imagen_id%}">
        {% if (file.error) { %}
            <td></td>
            <td class="name"><span>{%=file.name%}</span></td>
            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
            <td class="error rojo" colspan="2"><span class="label label-important">
				{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}
				{% if (!i) { %}
            		<input type="button" name="cancelar" value="Cancelar" onclick="removeFotoRow($(this))" class="button">			
        		{% } %}
			</td>
        {% } else { %}
            <td class="preview">{% if (file.thumbnail_url) { %}
				<img src="/uploads/<?php echo (($this->carpeta)!="") ? $this->carpeta."_previas/" : "" ?>{%=file.name%}" class="fotoVehiculo">
            {% } %}</td>
            <td class="name">
                <!-- <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a> -->
				{%=file.name%}
            </td>
            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
            <td colspan="2" id="actions">				

                <?php if ($this->carpeta !="") { ?>
                    <img src="/images/delete.png" title="Borrar Foto" onclick="return deleteFoto('{%=file.imagen_id%}' , '<?php echo Yii::app()->request->csrfToken ?>' , '<?php echo $this->carpeta ?>')" />
                <?php } else { ?>
                    <img src="/images/delete.png" title="Borrar Foto" onclick="return deleteFoto('{%=file.imagen_id%}' , '<?php echo Yii::app()->request->csrfToken ?>')" />
                <?php } ?>

<!--                &nbsp;Vista Previa-->
<!--				<input type="radio" name="vista_previa_activa" value="{%=file.imagen_id%}" title="Foto principal" -->
<!--					onclick="setVistaPrevia(this, '--><?php //echo $this->model->vehiculo_id ?><!--' , '--><?php //echo Yii::app()->request->csrfToken ?><!--')" />-->
			</td>			
        {% } %}
        
    </tr>
{% } %}
</script>
